home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.sprintlink.net!news1!ind-004-236-166
- From: dlmiller@iquest.net (Doug Miller)
- Subject: Re: operator % - compiler error
- X-Nntp-Posting-Host: ind-002-236-107.iquest.net
- Message-ID: <DoH503.Hu7@iquest.net>
- Sender: news@iquest.net (News Admin)
- Organization: IQuest Network Services
- X-Newsreader: News Xpress Version 1.0 Beta #2.1
- References: <4ihuuh$6ul@hatathli.csulb.edu>
- Date: Mon, 18 Mar 1996 17:40:38 GMT
-
- davidcho@csulb.edu (David Cho) wrote:
- +Xref: news1 comp.lang.c:71018
- +Path: news1!news.sprintlink.net!usenet.kornet.nm.kr!usenet.hana.nm.kr!usenet.seri.re.kr!news.cais.net!news.ac.net!imci4!newsfeed.internetmci.com!info.ucla.edu!library.ucla.edu!csulb.edu!davidcho
- +From: davidcho@csulb.edu (David Cho)
- +Newsgroups: comp.lang.c
- +Subject: operator % - compiler error
- +Date: 17 Mar 1996 21:07:29 GMT
- +Organization: Cal State Long Beach
- +Lines: 7
- +Message-ID: <4ihuuh$6ul@hatathli.csulb.edu>
- +NNTP-Posting-Host: heart.engr.csulb.edu
- +X-Newsreader: TIN [version 1.2 PL2]
- +
- +When I try to compile, I get an erro message for the following line:
- +
- +
- +x=663608941*y%pow(2,32) /*I want remainder*/
- +
- +But the error message says "illegal use of floating point". What does
- +that mean? Isn't % used a an operator to calcuate the remainder?
-
- You're right that % is the modulo operator.
-
- Hard to say for sure what caused the error, as you have not posted the declarations of x and y.
- But here are some suggestions. Remember that * is the indirection operator, as well as the
- multiplication operator; try putting spaces before and after the * so the compiler knows what
- you mean. Do the same with the % operator. And remember you need a semicolon at the end
- of your statement.
-
-